const unsigned char jet_colormap[256][3] = {
  {0, 0, 127},
  {0, 0, 137},
  {0, 0, 146},
  {0, 0, 156},
  {0, 0, 166},
  {0, 0, 176},
  {0, 0, 185},
  {0, 0, 195},
  {0, 0, 205},
  {0, 0, 215},
  {0, 0, 224},
  {0, 0, 234},
  {0, 0, 244},
  {0, 0, 254},
  {0, 0, 255},
  {0, 1, 255},
  {0, 9, 255},
  {0, 18, 255},
  {0, 26, 255},
  {0, 35, 255},
  {0, 43, 255},
  {0, 52, 255},
  {0, 61, 255},
  {0, 69, 255},
  {0, 78, 255},
  {0, 86, 255},
  {0, 95, 255},
  {0, 103, 255},
  {0, 112, 255},
  {0, 121, 255},
  {0, 129, 255},
  {0, 138, 255},
  {0, 146, 255},
  {0, 155, 255},
  {0, 163, 255},
  {0, 172, 255},
  {0, 181, 255},
  {0, 189, 255},
  {0, 198, 255},
  {0, 206, 255},
  {0, 215, 255},
  {0, 223, 251},
  {2, 232, 244},
  {9, 241, 237},
  {16, 249, 230},
  {23, 255, 223},
  {30, 255, 216},
  {36, 255, 209},
  {43, 255, 202},
  {50, 255, 195},
  {57, 255, 189},
  {64, 255, 182},
  {71, 255, 175},
  {78, 255, 168},
  {85, 255, 161},
  {92, 255, 154},
  {99, 255, 147},
  {106, 255, 140},
  {113, 255, 133},
  {119, 255, 126},
  {126, 255, 119},
  {133, 255, 113},
  {140, 255, 106},
  {147, 255, 99},
  {154, 255, 92},
  {161, 255, 85},
  {168, 255, 78},
  {175, 255, 71},
  {182, 255, 64},
  {189, 255, 57},
  {195, 255, 50},
  {202, 255, 43},
  {209, 255, 36},
  {216, 255, 30},
  {223, 255, 23},
  {230, 255, 16},
  {237, 255, 9},
  {244, 248, 2},
  {251, 240, 0},
  {255, 232, 0},
  {255, 224, 0},
  {255, 216, 0},
  {255, 208, 0},
  {255, 200, 0},
  {255, 192, 0},
  {255, 184, 0},
  {255, 176, 0},
  {255, 168, 0},
  {255, 161, 0},
  {255, 153, 0},
  {255, 145, 0},
  {255, 137, 0},
  {255, 129, 0},
  {255, 121, 0},
  {255, 113, 0},
  {255, 105, 0},
  {255, 97, 0},
  {255, 89, 0},
  {255, 81, 0},
  {255, 73, 0},
  {255, 65, 0},
  {255, 57, 0},
  {255, 49, 0},
  {255, 41, 0},
  {255, 34, 0},
  {255, 26, 0},
  {254, 18, 0},
  {244, 10, 0},
  {234, 2, 0},
  {224, 0, 0},
  {215, 0, 0},
  {205, 0, 0},
  {195, 0, 0},
  {185, 0, 0},
  {176, 0, 0},
  {166, 0, 0},
  {156, 0, 0},
  {146, 0, 0},
  {137, 0, 0},
  {127, 0, 0}
};

const unsigned char magma_colormap[256][3] = {
  {251, 252, 191},
  {251, 250, 189},
  {251, 249, 187},
  {251, 247, 185},
  {252, 245, 183},
  {252, 243, 181},
  {252, 241, 179},
  {252, 240, 177},
  {252, 238, 176},
  {252, 236, 174},
  {252, 234, 172},
  {252, 232, 170},
  {252, 230, 168},
  {252, 229, 166},
  {252, 227, 165},
  {253, 225, 163},
  {253, 223, 161},
  {253, 221, 159},
  {253, 220, 157},
  {253, 218, 156},
  {253, 216, 154},
  {253, 214, 152},
  {253, 212, 151},
  {253, 210, 149},
  {253, 209, 147},
  {253, 207, 146},
  {253, 205, 144},
  {254, 203, 142},
  {254, 201, 141},
  {254, 199, 139},
  {254, 198, 137},
  {254, 196, 136},
  {254, 194, 134},
  {254, 192, 133},
  {254, 190, 131},
  {254, 188, 130},
  {254, 187, 128},
  {254, 185, 127},
  {254, 183, 125},
  {254, 181, 124},
  {254, 179, 123},
  {254, 177, 121},
  {254, 175, 120},
  {254, 174, 118},
  {254, 172, 117},
  {254, 170, 116},
  {254, 168, 115},
  {254, 166, 113},
  {253, 164, 112},
  {253, 162, 111},
  {253, 161, 110},
  {253, 159, 108},
  {253, 157, 107},
  {253, 155, 106},
  {253, 153, 105},
  {253, 151, 104},
  {253, 149, 103},
  {252, 147, 102},
  {252, 146, 101},
  {252, 144, 100},
  {252, 142, 99},
  {252, 140, 99},
  {251, 138, 98},
  {251, 136, 97},
  {251, 134, 96},
  {251, 132, 96},
  {250, 130, 95},
  {250, 128, 94},
  {250, 127, 94},
  {249, 125, 93},
  {249, 123, 93},
  {249, 121, 92},
  {248, 119, 92},
  {248, 117, 92},
  {247, 115, 92},
  {247, 113, 91},
  {246, 112, 91},
  {246, 110, 91},
  {245, 108, 91},
  {245, 106, 91},
  {244, 104, 91},
  {243, 103, 91},
  {243, 101, 92},
  {242, 99, 92},
  {241, 97, 92},
  {240, 96, 93},
  {239, 94, 93},
  {238, 93, 93},
  {238, 91, 94},
  {237, 89, 95},
  {236, 88, 95},
  {235, 86, 96},
  {234, 85, 96},
  {232, 84, 97},
  {231, 82, 98},
  {230, 81, 98},
  {229, 80, 99},
  {228, 78, 100},
  {226, 77, 101},
  {225, 76, 102},
  {224, 75, 102},
  {222, 74, 103},
  {221, 73, 104},
  {220, 72, 105},
  {218, 71, 105},
  {217, 70, 106},
  {215, 69, 107},
  {214, 68, 108},
  {212, 67, 109},
  {211, 66, 109},
  {209, 66, 110},
  {208, 65, 111},
  {206, 64, 112},
  {205, 63, 112},
  {203, 62, 113},
  {202, 62, 114},
  {200, 61, 114},
  {198, 60, 115},
  {197, 60, 116},
  {195, 59, 116},
  {194, 58, 117},
  {192, 58, 117},
  {190, 57, 118},
  {189, 57, 119},
  {187, 56, 119},
  {185, 55, 120},
  {184, 55, 120},
  {182, 54, 121},
  {181, 54, 121},
  {179, 53, 122},
  {177, 53, 122},
  {176, 52, 123},
  {174, 52, 123},
  {172, 51, 123},
  {171, 51, 124},
  {169, 50, 124},
  {167, 49, 125},
  {166, 49, 125},
  {164, 48, 125},
  {163, 48, 126},
  {161, 47, 126},
  {159, 47, 126},
  {158, 46, 126},
  {156, 46, 127},
  {154, 45, 127},
  {153, 45, 127},
  {151, 44, 127},
  {149, 44, 128},
  {148, 43, 128},
  {146, 43, 128},
  {145, 42, 128},
  {143, 42, 128},
  {141, 41, 128},
  {140, 41, 128},
  {138, 40, 129},
  {137, 40, 129},
  {135, 39, 129},
  {133, 38, 129},
  {132, 38, 129},
  {130, 37, 129},
  {129, 37, 129},
  {127, 36, 129},
  {126, 36, 129},
  {124, 35, 129},
  {122, 34, 129},
  {121, 34, 129},
  {119, 33, 129},
  {118, 33, 129},
  {116, 32, 129},
  {115, 31, 129},
  {113, 31, 129},
  {111, 30, 129},
  {110, 30, 129},
  {108, 29, 128},
  {107, 28, 128},
  {105, 28, 128},
  {104, 27, 128},
  {102, 26, 128},
  {101, 26, 128},
  {99, 25, 127},
  {97, 24, 127},
  {96, 24, 127},
  {94, 23, 127},
  {93, 23, 126},
  {91, 22, 126},
  {90, 21, 126},
  {88, 21, 126},
  {87, 20, 125},
  {85, 19, 125},
  {83, 19, 124},
  {82, 18, 124},
  {80, 18, 123},
  {79, 17, 123},
  {77, 17, 122},
  {75, 16, 121},
  {74, 16, 121},
  {72, 16, 120},
  {71, 15, 119},
  {69, 15, 118},
  {67, 15, 117},
  {66, 15, 116},
  {64, 15, 115},
  {62, 15, 114},
  {60, 15, 113},
  {59, 15, 111},
  {57, 15, 110},
  {55, 15, 108},
  {53, 15, 106},
  {52, 16, 104},
  {50, 16, 103},
  {48, 16, 101},
  {47, 16, 98},
  {45, 16, 96},
  {43, 17, 94},
  {42, 17, 92},
  {40, 17, 89},
  {38, 17, 87},
  {37, 17, 85},
  {35, 17, 82},
  {34, 17, 80},
  {32, 17, 77},
  {31, 17, 75},
  {30, 16, 73},
  {28, 16, 70},
  {27, 16, 68},
  {26, 16, 65},
  {24, 15, 63},
  {23, 15, 60},
  {22, 14, 58},
  {21, 14, 56},
  {20, 13, 53},
  {18, 13, 51},
  {17, 12, 49},
  {16, 12, 47},
  {15, 11, 44},
  {14, 10, 42},
  {13, 10, 40},
  {12, 9, 38},
  {11, 8, 36},
  {10, 7, 34},
  {9, 7, 31},
  {8, 6, 29},
  {7, 5, 27},
  {6, 5, 25},
  {5, 4, 23},
  {4, 4, 21},
  {4, 3, 19},
  {3, 3, 17},
  {2, 2, 15},
  {2, 2, 13},
  {1, 1, 11},
  {1, 1, 9},
  {1, 0, 7},
  {0, 0, 6},
  {0, 0, 4},
  {0, 0, 3},
};

